package com.zone.service.service.impl;

import java.util.List;
import com.zone.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zone.service.mapper.BoxInfoMapper;
import com.zone.service.domain.BoxInfo;
import com.zone.service.service.IBoxInfoService;

/**
 * 款箱信息Service业务层处理
 * 
 * @author liuyang
 * @date 2025-10-31
 */
@Service
public class BoxInfoServiceImpl implements IBoxInfoService 
{
    @Autowired
    private BoxInfoMapper boxInfoMapper;

    /**
     * 查询款箱信息
     * 
     * @param id 款箱信息主键
     * @return 款箱信息
     */
    @Override
    public BoxInfo selectBoxInfoById(Long id)
    {
        return boxInfoMapper.selectBoxInfoById(id);
    }

    /**
     * 查询款箱信息列表
     * 
     * @param boxInfo 款箱信息
     * @return 款箱信息
     */
    @Override
    public List<BoxInfo> selectBoxInfoList(BoxInfo boxInfo)
    {
        return boxInfoMapper.selectBoxInfoList(boxInfo);
    }

    /**
     * 新增款箱信息
     * 
     * @param boxInfo 款箱信息
     * @return 结果
     */
    @Override
    public int insertBoxInfo(BoxInfo boxInfo)
    {
        boxInfo.setCreateTime(DateUtils.getNowDate());
        return boxInfoMapper.insertBoxInfo(boxInfo);
    }

    /**
     * 修改款箱信息
     * 
     * @param boxInfo 款箱信息
     * @return 结果
     */
    @Override
    public int updateBoxInfo(BoxInfo boxInfo)
    {
        boxInfo.setUpdateTime(DateUtils.getNowDate());
        return boxInfoMapper.updateBoxInfo(boxInfo);
    }

    /**
     * 批量删除款箱信息
     * 
     * @param ids 需要删除的款箱信息主键
     * @return 结果
     */
    @Override
    public int deleteBoxInfoByIds(Long[] ids)
    {
        return boxInfoMapper.deleteBoxInfoByIds(ids);
    }

    /**
     * 删除款箱信息信息
     * 
     * @param id 款箱信息主键
     * @return 结果
     */
    @Override
    public int deleteBoxInfoById(Long id)
    {
        return boxInfoMapper.deleteBoxInfoById(id);
    }
    
    /**
     * 批量插入款箱数据
     *
     * @param boxInfoList 款箱信息列表
     * @return 结果
     */
    @Override
    public int batchInsertBoxInfo(List<BoxInfo> boxInfoList) {
        return boxInfoMapper.batchInsertBoxInfo(boxInfoList);
    }
}